home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk25 / virusx20 / vx.asm < prev   
Assembly Source File  |  1995-03-18  |  1KB  |  57 lines

  1. ;
  2. ;
  3. ;
  4. ;  The ASSEMBLER portion of VirusX starts here.  This is where some of the
  5. ;  more often called routines now live - in the smallness of Assembler.
  6. ;
  7. ;
  8.     xref _geta4
  9.     xref _diskreq
  10.     xref _diskbuffer
  11.     xref _LVODoIO
  12.     xdef _ReadBlock
  13.  
  14. ;
  15. ;  ReadBlock:  This will read the boot block.  Yay.
  16. ;
  17. _ReadBlock:
  18.     movem.l d1/a0/a1/a4/a5/a6,-(sp)
  19.     jsr _geta4
  20.  
  21.     move.l _diskreq,a0
  22.     move.w #2,$1c(a0)         ; diskreq->io_Command = CMD_READ;
  23.     lea _diskbuffer,a1
  24.     move.l a1,d0
  25.     move.l d0,$28(a0)         ; diskreq->io_Data = diskbuffer;
  26.     move.l #(3*512),$24(a0)     ; diskreq->io_Length = 3*512;
  27.     move.l #0,$2c(a0)        ; diskreq->io_Offset = 0;
  28.     move.l 4,a6
  29.  
  30.     move.l _diskreq,a1
  31.     jsr _LVODoIO(a6)        ; DoIO(diskreq);
  32.  
  33.     move.l _diskreq,a0
  34.     cmp.b #0,$1f(a0)        ; check io_Error
  35.     beq IsOkay            ; if (diskreq->io_Error > 0) return(FALSE);    /* disk error, lemme out */
  36.  
  37. ReturnError:
  38.     move.l #0,d0            ; return error
  39.     movem.l (sp)+,d1/a0/a1/a4/a5/a6
  40.     rts
  41.  
  42. IsOkay:
  43.     move.l #0,$24(a0)        ; diskreq->io_Length = 0;
  44.     move.w #9,$1c(a0)        ; diskreq->io_Command = TD_MOTOR;
  45.  
  46.     move.l _diskreq,a1    
  47.     move.l 4,a6
  48.     jsr _LVODoIO(a6)        ; DoIO(diskreq);                /* turn off motor */
  49.  
  50.     move.l _diskreq,a0
  51.     cmp.b #0,$1f(a0)
  52.     bne ReturnError
  53.  
  54.     move.l #1,d0
  55.     movem.l (sp)+,d1/a0/a1/a4/a5/a6
  56.     rts
  57.